Hybris Sales UX API
resource - TMF-639 GET (PIB)
This API allows the client to retrieve device details (IMEI, ICCID & SKU) from SAP.
URL
https://[localhost]:[port]/ecom-sales-ux/v1/{businessId}/resource
URL PARAMS
name | type | description | required |
---|---|---|---|
businessId | string | 2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit. | Y |
Header
name | value | description | required |
---|---|---|---|
client_id | string | The client_id identifying the channel. | Y |
client_secret | string | Password associated with the client_id. | Y |
X-Correlation-ID | string | Identifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction. | Y |
Query Param
name | type | description | required |
---|---|---|---|
resourceCharacteristics.value | string | The value of the characteristic, in this case, it will be Activation Code (scanned unique random identifier for both ICCID & IMEI ) | Y |
resourceCharacteristics.name | string | Name of the characteristic Ex. activationCode | Y |
@type | string | When sub-classing, this defines the sub-class Extensible name Ex. "PhysicalResource" | Y |
Request
curl --location 'https://nonprod.esb.cloud.lla.com/dev/ecom-sales-ux/ecom-sales-ux/v1/PR/resource?resourceCharacteristic.name=activationCode&resourceCharacteristic.value=500020&%40type=PhysicalResource' \
--header 'client_id: abcde' \
--header 'client_secret: 12345' \
--header 'X-Correlation-ID: 644e1dd7-2a7f-18fb-b8ed-ed78c3F92cEE'
Possible response success
This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.
[ 200 ]
OK - update request processed successfully, response body contains an entity corresponding to the requested resource.
{
"id": "000100000000040439",
"@type": "PhysicalResource",
"name": "IMEI Number",
"resourceCharacteristic": [
{
"value": "500020",
"name": "activationCode"
}
],
"resourceSpecification": {
"id": "000000000000117052",
"name": "MobileDeviceSKU",
"@referredType": "PhysicalResourceSpecification"
},
"resourceRelationship": [
{
"relationshipType": "paried",
"resource": {
"id": "10345267",
"name": "ICCID Number",
"@type": "PhysicalResource",
"resourceSpecification": {
"id": "000000000000117088",
"name": "SIMCardSKU",
"@referredType": "PhysicalResourceSpecification"
}
}
}
]
}
Definitions
Each of the response parameters is detailed for GET /resource response body
Field Name | DataType | Description | Required |
---|---|---|---|
id | string | Identifier of an instance of the resource. In this case IMEI | N |
@type | string | Type of the resource | N |
name | string | Name to the resource. | N |
resourceCharacteristic | array | A list of characteristics (Characteristic [*]). | N |
resourceCharacteristic.name | string | Name of the characteristic | N |
resourceCharacteristic.value | any | The value of the characteristic | N |
resourceSpecification | object | A resource specification reference | N |
resourceSpecification.id | string | Mobile Device SKU | N |
resourceSpecification.name | string | Name of the requiredResourceSpecification | N |
resourceSpecification.@referredType | string | referred type | N |
resourceRelationship | array | A list of resource relationships | N |
resourceRelationship.relationshipType | string | Type of the resource relationship | N |
resourceRelationship.resource | object | A resource ref or value | N |
resourceRelationship.id | string | ICCID Number | N |
resourceRelationship.name | string | Name to the resource. | N |
resourceRelationship.@type | string | Type of resource | N |
resourceRelationship.resource.resourceSpecification | object | Resource Specification reference | N |
resourceRelationship.resource.resourceSpecification.id | string | SIM Card SKU | N |
resourceRelationship.resource.resourceSpecification.name | string | Name of the requiredResourceSpecification. | N |
resourceRelationship.resource.resourceSpecification.@referredType | string | referred type | N |
Possible response error
In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.
[ 400 ]
Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
{
"errors": [
{
"code": 400,
"message" : "INVALID_PARAMETER",
"description" : "Please Verify the Mandatory Parameters"
}
]
}
[ 401 ]
Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.
{
"errors" : [{
"code" : 401,
"message" : "The user could not be authenticated for this request.",
"description" : "The request has not been applied because it lacks valid authentication credentials for the target resource"
}]
}
[ 403 ]
Forbidden - Indicates that the server understood the request but refuses to fulfill it. If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials.
[ 404 ]
Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
{
"errors" : [{
"code" : 404,
"message" : "The request is invalid or not properly formed.",
"description" : "The requested operation failed because a resource associated with the request could not be found."
}]
}
[ 405 ]
Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
{
"errors": [{
"code": 405,
"message": "APIKIT:METHOD_NOT_ALLOWED",
"description": "HTTP Method POST not allowed for : /{businessId}/resource"
}]
}
[ 500 ]
Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.
{
"errors" : [{
"code" : 500,
"message" : "The request failed due to an internal error.",
"description": "error description"
}]
}
[ 501 ]
Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.
{
"errors" : [{
"code" : 501,
"message" : "Not implemented",
"description" : "Operation GET /resource for Business Id: xxxx not implemented"
}]
}
[ 502]
Bad Gateway - gateway is available but backend service is not. The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.
[ 503 ]
Service Unavailable - temporary maintenance of service, try again later. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay will be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response. Note: The existence of the 503 status code does not imply that a server will use it when becoming overloaded. Servers may simply refuse the connection.
Retry-After: 120